package com.ccit.paas.rpc.feign;

import com.ccit.paas.rpc.dto.req.FlowRestApiAuthInfoAddReq;
import com.ccit.paas.rpc.dto.req.PageRequest;
import com.ccit.paas.rpc.dto.resp.FlowRestApiAuthInfoResp;
import com.ccit.paas.rpc.dto.resp.PageResult;
import com.ccit.paas.rpc.vo.ResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * feign接口调用示例
 *
 * @FeignClient注解使用说明： contextId:配置成当前类名的小写，value：微服务的名称，fallbackFactory：降级策略，兜底类
 * @author: chinacoalit.com
 * @date 2024/1/9 15:47
 * @version: v1.0 初始化
 */
@FeignClient(contextId = "flowAuthFeignService", value = "auth-demo", path = "/webapi/auth")
public interface FlowAuthFeignService {

    @PostMapping("/save")
    ResponseVO<Boolean> saveAuth(FlowRestApiAuthInfoAddReq req);


    @PostMapping("/update")
    ResponseVO<Boolean> updateAuth(FlowRestApiAuthInfoAddReq req);

    @GetMapping("/del")
    ResponseVO deleteAuth(@RequestParam String appId);

    @PostMapping("/page")
    ResponseVO<PageResult<FlowRestApiAuthInfoResp>> getWfFlowAuthPageList(PageRequest pageRequest);

    /**
     * say hello
     */
    @GetMapping("/all")
    String getAuthList();
}
